package diDemo;


public class MyFramework {
	public static void main(String[] args) {
		
//		Phper phper = new Phper("php");
//		Task t = new Task("task #1", phper);
//		t.start();
//		String a = "abc";
//		System.out.println(hash(a.hashCode()));
		Runnable t1 = new Test();
		new Thread(t1,"t1").start();
		new Thread(t1,"t2").start();

	}
	//计算hash值的方法 通过键的hashCode来计算
    static int hash(int h) {
        // This function ensures that hashCodes that differ only by
        // constant multiples at each bit position have a bounded
        // number of collisions (approximately 8 at default load factor).
        h ^= (h >>> 20) ^ (h >>> 12);
        return h ^ (h >>> 7) ^ (h >>> 4);
    }
    
    
}
class Test implements Runnable{

	@Override
	public void run() {
		// TODO Auto-generated method stub
		synchronized (this) {
			for(int i=0; i<5; i++){
				System.out.println(Thread.currentThread().getName()+":"+i);
			}
		}
	}
	
}